
$(function(){
	
	//判断电脑还是手机
	browserRedirect()
	
	//全屏效果
	$('.swiper-container .swiper-wrapper').css('height',client().height)
	$('.swiper-container .swiper-slide').css('height',client().height)
	var swiper = new Swiper('.swiper-container', {
        direction: 'vertical',
        followFinger : false,
		speed:800,
        mousewheel: true,
		spaceBetween: 30,
		effect: 'fade',
        pagination: {
			el: '.swiper-pagination',
			dynamicBullets: true,
		},
		on:{
			init:function(swiper){
		        slide=this.slides.eq(0);
			    slide.addClass('ani-slide');
		    },
			transitionStart: function(){
			    for(i=0;i<this.slides.length;i++){
			    	slide=this.slides.eq(i);
			        slide.removeClass('ani-slide');
				}
		    },
			transitionEnd: function(){
				slide=this.slides.eq(this.activeIndex);
			    slide.addClass('ani-slide');
		    },
		}
    });
   
    
    //第一页
    $('.header').css('height',client().height)
    $(".movie").hover3d({
		selector: ".movie__card",
		shine: true,
		sensitivity: 100,
	});
	
	//  六角 数据
	$.ajax({
		type:"GET",
		url:'mafei.json',
		dataType:"JSON",
		success:function(data){
			var html=''
			$.each(data.tabico,function(i){
				html+='<li class="hex" id="'+data.tabico[i].id+'">'
				html+='<div class="hexIn">'
				html+='<img src="'+data.tabico[i].img+'"/>'
				html+=''
				html+='<a class="ah1" href="'+data.tabico[i].url+'" target="_blank">'+data.tabico[i].title+'</a>'
				html+='<a class="ap" href="'+data.tabico[i].url+'" target="_blank">'+data.tabico[i].content+'</a>'
				html+=''
				html+='<div>'
				html+='</li>'
			})
			$('.hexGrid').empty().append(html)
			dbrpositionIn('.succdloc')
			
		}	
	})
    
    //设计图片
	$('.Own_img li img').click(function(){
		$('.Own_img_d').show()
		$('.Own_img_d img').attr('src',$(this).attr('src'))
		dbrpositionIn('.Own_img_d img')
	})
	$('.Own_img_d').click(function(){
		$('.Own_img_d').hide()
	})
	
	
	//播放器
	var myVideo=document.getElementById("yinyue"); 
	$('.bofang').attr('class','bofang bol2')
	$('.bofang').click(function(){
		if (myVideo.paused) {
			$('.bofang').attr('class','bofang bol2')
			myVideo.play(); 
		}else{ 
			myVideo.pause();
			$('.bofang').attr('class','bofang bol1')
		}
	})
	$('.music').hover(function(){
		$(this).stop().animate({"left":0},200)
	},function(){
		$(this).stop().animate({"left":-62},200)
	})
    
	
})
